package jsyf.oa.entity.system;

import com.alibaba.fastjson.JSONObject;
import jsyf.oa.ientity.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

@Entity
@Table(name = "T_SYS_AUDIT", schema = "oa", catalog = "")
public class AuditEntity extends BaseEntity implements Serializable {

    private String mainId;
    private String auditorId;
    private String auditorName;
    private String roleName;
    private Integer auditFlag;
    private Integer auditSort;
    private Date auditTime;
    private String auditAdvise;
    private String moduleName;
    private String userId;
    private String receivableIds;//应收申请的ids;

    public String getReceivableIds() {
        return receivableIds;
    }

    public void setReceivableIds(String receivableIds) {
        this.receivableIds = receivableIds;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public String getMainId() {
        return mainId;
    }

    public void setMainId(String mainId) {
        this.mainId = mainId;
    }

    public String getAuditorId() {
        return auditorId;
    }

    public void setAuditorId(String auditorId) {
        this.auditorId = auditorId;
    }

    public String getAuditorName() {
        return auditorName;
    }

    public void setAuditorName(String auditorName) {
        this.auditorName = auditorName;
    }

    public Integer getAuditFlag() {
        return auditFlag;
    }

    public void setAuditFlag(Integer auditFlag) {
        this.auditFlag = auditFlag;
    }

    public Integer getAuditSort() {
        return auditSort;
    }

    public void setAuditSort(Integer auditSort) {
        this.auditSort = auditSort;
    }

    public Date getAuditTime() {
        return auditTime;
    }

    public void setAuditTime(Date auditTime) {
        this.auditTime = auditTime;
    }

    public String getAuditAdvise() {
        return auditAdvise;
    }

    public void setAuditAdvise(String auditAdvise) {
        this.auditAdvise = auditAdvise;
    }

    public String getModuleName() {
        return moduleName;
    }

    public void setModuleName(String moduleName) {
        this.moduleName = moduleName;
    }

    @Override
    public JSONObject getJSONObject() {
        JSONObject json = new JSONObject();
        json.put("ID", this.getId());
        json.put("MAIN_ID", this.getMainId());
        json.put("AUDITOR_ID", this.getAuditorId());
        json.put("AUDITOR_NAME", this.getAuditorName());
        json.put("AUDIT_FLAG", this.getAuditFlag());
        json.put("AUDIT_TIME", this.getAuditTime());
        json.put("AUDIT_ADVISE", this.getAuditAdvise());
        json.put("AUDIT_SORT", this.getAuditSort());
        json.put("MODULE_NAME", this.getModuleName());
        json.put("ROLE_NAME", this.getRoleName());
        json.put("RECEIVABLE_IDS", this.getReceivableIds());
        return json;
    }

    @Override
    public String getTableName() {
        return "T_SYS_AUDIT";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject json = new JSONObject();
        json.put("ID", "id");
        json.put("MAIN_ID", "mainId");
        json.put("AUDITOR_ID", "auditorId");
        json.put("AUDITOR_NAME", "auditorName");
        json.put("AUDIT_FLAG", "auditFlag");
        json.put("AUDIT_TIME", "auditTime");
        json.put("AUDIT_ADVISE", "auditAdvise");
        json.put("AUDIT_SORT", "auditSort");
        json.put("MODULE_NAME", "moduleName");
        json.put("ROLE_NAME", "roleName");
        json.put("RECEIVABLE_IDS","receivableIds");

        return json;
    }
}
